package com.bysj.system.mapper;

import java.util.List;
import com.bysj.system.domain.HouseListing;
import org.apache.ibatis.annotations.Select;

/**
 * 房源Mapper接口
 *
 * @author bysj
 * @date 2024-02-03
 */
public interface HouseListingMapper
{

    @Select("SELECT province FROM bysj_provinces WHERE provinceid = #{id}")
    String selectProvince(Long id);
    @Select("SELECT city FROM bysj_citys WHERE cityid = #{id}")
    String selectCity(Long id);
    @Select("SELECT district FROM bysj_districts WHERE areaid = #{id}")
    String selectDistrict(Long id);
    /**
     * 查询房源
     *
     * @param id 房源主键
     * @return 房源
     */
    public HouseListing selectHouseListingById(Long id);

    /**
     * 查询房源列表
     *
     * @param houseListing 房源
     * @return 房源集合
     */
    public List<HouseListing> selectHouseListingList(HouseListing houseListing);

    /**
     * 新增房源
     *
     * @param houseListing 房源
     * @return 结果
     */
    public int insertHouseListing(HouseListing houseListing);

    /**
     * 修改房源
     *
     * @param houseListing 房源
     * @return 结果
     */
    public int updateHouseListing(HouseListing houseListing);

    /**
     * 删除房源
     *
     * @param id 房源主键
     * @return 结果
     */
    public int deleteHouseListingById(Long id);

    /**
     * 批量删除房源
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteHouseListingByIds(Long[] ids);
}
